package com.demo.core.model;

import java.util.List;

import com.demo.core.model.support.NestedSetModel;

/**
 * Menu菜单模型
 * @author ryuu.kk
 *
 */
public class Menu extends NestedSetModel {

	/**
	 * 版本序列化ID
	 */
	private static final long serialVersionUID = -8314273796812697812L;

	/**
	 * navibar
	 */
	public static final String TYPE_NAVIBAR = "0";
	
	/**
	 * menu
	 */
	public static final String TYPE_MENU = "1";
	
	/**
	 * 主键ID
	 */
	private Long id;
	
	/**
	 * 父ID
	 */
	private Long pid;
	
	/**
	 * 站点ID
	 */
	private Long siteId;
	
	/**
	 * 站点功能主键ID
	 */
	private Long siteFunctionId;
	
	/**
	 * 站点组模型ID(冗余属性)
	 */
	private Long siteGroupId;
	
	/**
	 * Menu名
	 */
	private String name;
	
	/**
	 * 菜单标题
	 */
	private String title;
	
	/**
	 * Menu地址
	 */
	private String url;
	
	/**
	 * 选中条件
	 */
	private String pattern;
	
	/**
	 * 菜单html的class
	 */
	private String css;
	
	/**
	 * 菜单样式
	 */
	private String style;
	
	/**
	 * 国际化CODE
	 */
	private String i18n;
	
	/**
	 * 类型
	 */
	private String type;
	
	/**
	 * 数据状态
	 * R:可读;
	 * W:可改;
	 * D:可删;
	 */
	private String status;
	
	/**
	 * 可用标志
	 */
	private boolean enabled;
	
	/**
	 * 菜单允许匿名访问
	 * 默认菜单可匿名访问
	 */
	private boolean isAnonymous = false;
	
	/**
	 * 优先级排序
	 */
	private int priority;
	
	/**
	 * 站点功能模型
	 */
	private SiteFunction siteFunction;

	/**
	 * 菜单的访问权限列表
	 */
	private List<Role> roleList;
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Long getSiteId() {
		return siteId;
	}

	public void setSiteId(Long siteId) {
		this.siteId = siteId;
	}

	public Long getSiteFunctionId() {
		return siteFunctionId;
	}

	public void setSiteFunctionId(Long siteFunctionId) {
		this.siteFunctionId = siteFunctionId;
	}

	public Long getSiteGroupId() {
		return siteGroupId;
	}

	public void setSiteGroupId(Long siteGroupId) {
		this.siteGroupId = siteGroupId;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getI18n() {
		return i18n;
	}

	public void setI18n(String i18n) {
		this.i18n = i18n;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public boolean isEnabled() {
		return enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getPattern() {
		return pattern;
	}

	public void setPattern(String pattern) {
		this.pattern = pattern;
	}

	public String getCss() {
		return css;
	}

	public void setCss(String css) {
		this.css = css;
	}

	public String getStyle() {
		return style;
	}

	public void setStyle(String style) {
		this.style = style;
	}

	public boolean isAnonymous() {
		return isAnonymous;
	}

	public void setAnonymous(Boolean isAnonymous) {
		this.isAnonymous = isAnonymous == null ? true : isAnonymous;
	}

	public int getPriority() {
		return priority;
	}

	public void setPriority(int priority) {
		this.priority = priority;
	}

	public List<Role> getRoleList() {
		return roleList;
	}

	public void setRoleList(List<Role> roleList) {
		this.roleList = roleList;
	}

	public SiteFunction getSiteFunction() {
		return siteFunction;
	}

	public void setSiteFunction(SiteFunction siteFunction) {
		this.siteFunction = siteFunction;
	}
}
